package com.ruoyi.jkcrData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.jkcrData.domain.plat.DataJkcrQyl;
import com.ruoyi.jkcrData.mapper.DataJkcrQylMapper;
import com.ruoyi.jkcrData.service.IDataJkcrQylService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 架空乘人牵引力测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-19
 */
@Service
public class DataJkcrQylServiceImpl implements IDataJkcrQylService
{
    @Autowired(required = false)
    private DataJkcrQylMapper dataJkcrQylMapper;

    /**
     * 查询架空乘人牵引力测试数据
     * 
     * @param qylId 架空乘人牵引力测试数据主键
     * @return 架空乘人牵引力测试数据
     */
    @Override
    public DataJkcrQyl selectDataJkcrQylByQylId(Long qylId)
    {
        return dataJkcrQylMapper.selectDataJkcrQylByQylId(qylId);
    }

    /**
     * 根据dataTaskId获取数据
     *
     * @param dataTaskId
     */
    @Override
    public Future<List<DataJkcrQyl>> selectDataJkcrQylByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataJkcrQylMapper.selectDataJkcrQylByDataTaskId(dataTaskId));
    }

    /**
     * 查询架空乘人牵引力测试数据列表
     * 
     * @param dataJkcrQyl 架空乘人牵引力测试数据
     * @return 架空乘人牵引力测试数据
     */
    @Override
    public List<DataJkcrQyl> selectDataJkcrQylList(DataJkcrQyl dataJkcrQyl)
    {
        return dataJkcrQylMapper.selectDataJkcrQylList(dataJkcrQyl);
    }

    /**
     * 新增架空乘人牵引力测试数据
     * 
     * @param dataJkcrQyl 架空乘人牵引力测试数据
     * @return 结果
     */
    @Override
    public int insertDataJkcrQyl(DataJkcrQyl dataJkcrQyl)
    {
        dataJkcrQyl.setCreateTime(DateUtils.getNowDate());
        return dataJkcrQylMapper.insertDataJkcrQyl(dataJkcrQyl);
    }

    /**
     * 批量新增架空乘人牵引力测试数据
     *
     * @param dataJkcrQyl
     */
    @Override
    public int batchDataJkcrQyl(List<DataJkcrQyl> dataJkcrQyl) {
        return dataJkcrQylMapper.batchDataJkcrQyl(dataJkcrQyl);
    }

    /**
     * 修改架空乘人牵引力测试数据
     * 
     * @param dataJkcrQyl 架空乘人牵引力测试数据
     * @return 结果
     */
    @Override
    public int updateDataJkcrQyl(DataJkcrQyl dataJkcrQyl)
    {
        dataJkcrQyl.setUpdateTime(DateUtils.getNowDate());
        return dataJkcrQylMapper.updateDataJkcrQyl(dataJkcrQyl);
    }

    /**
     * 变更数据状态
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataJkcrQylByDataTaskId(Long dataTaskId) {
        return dataJkcrQylMapper.updateDataJkcrQylByDataTaskId(dataTaskId);
    }

    /**
     * 变更数据状态
     *
     * @param qylId
     * @return 结果
     */
    @Override
    public int updateDataJkcrQylByQylId(Long qylId) {
        return dataJkcrQylMapper.updateDataJkcrQylByQylId(qylId);
    }

    /**
     * 批量删除架空乘人牵引力测试数据
     * 
     * @param qylIds 需要删除的架空乘人牵引力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataJkcrQylByQylIds(Long[] qylIds)
    {
        return dataJkcrQylMapper.deleteDataJkcrQylByQylIds(qylIds);
    }

    /**
     * 删除架空乘人牵引力测试数据信息
     * 
     * @param qylId 架空乘人牵引力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataJkcrQylByQylId(Long qylId)
    {
        return dataJkcrQylMapper.deleteDataJkcrQylByQylId(qylId);
    }
}
